package com.szpx.service.impl;

import com.szpx.entity.lishihui.Cinema;
import com.szpx.mapper.CinemaMapper;
import com.szpx.service.CinemaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class CinemaImpl implements CinemaService {

    @Autowired
    private CinemaMapper cinemaMapper;

    @Override
    public List<Cinema> allCinema() {
        return cinemaMapper.selectAll();
    }

    @Override
    public void addCinema(Cinema cinema) {
        cinemaMapper.insertSelective(cinema);
    }

    //删除电影
    @Override
    public void deleteCinema(Integer id) {
        cinemaMapper.deleteId(id);
    }
}
